$(document).ready(function () {
  // 在这里写你的代码...
  init();
});
//初始化
function init() {
  chuyuanfeiyongFun();
  zhuyuanrenshuFun();
  menzhenfeiyongfenxiFun();
  jiuzhenzhenduanfenxiFun();
  chuangweishiyongfenxiFun();
}
//返回上一页
function retrunPage() {
  goprevPage();
}
// 各科室出院患者费用分析选项卡
function gekeshichuyuanhuanzhefenxiFun(dataArr) {
  //急诊住院部
  var jzzybArr = dataArr.jzzyb;
  // 外科住院部
  var waikeArr = dataArr.wkzyb;
  // 骨科住院部
  var gukeArr = dataArr.gkzyb;
  //康复理疗住院部
  var kfllArr = dataArr.kfllzyb;
  //血透室
  var xtsArr = dataArr.xts;
  //内科住院部
  var neikeArr = dataArr.nkzyb;

  $("#fuhankezhuyuanbuId").click(function () {
    $("#fuchankezhuyuanbuBgId").show();
    $("#jizhenzhuyuanbuBgId").hide();
    $("#gukezhuyuanbuBgId").hide();
    $("#xuetoushiBgId").hide();
    $("#kangfuzhuyaunbuBgId").hide();
    $("#neikeBgId").hide();
    $("#waikezhuyaunbuBgId").hide();
    // 线
    $(this).children().eq(1).show();
    $("#jizhenzhuyuanbuId").children().eq(1).hide();
    $("#gukezhuyuanbuId").children().eq(1).hide();
    $("#xuejishiId").children().eq(1).hide();
    $("#waikezhuyuanbuId").children().eq(1).hide();
    $("#neikezhuyuanbuId").children().eq(1).hide();
    $("#kangfuzhuyuanbuId").children().eq(1).hide();
    // leftCfuchankezhuyuanFun();
  });
  $("#jizhenzhuyuanbuId").click(function () {
    $("#fuchankezhuyuanbuBgId").hide();
    $("#jizhenzhuyuanbuBgId").show();
    $("#gukezhuyuanbuBgId").hide();
    $("#xuetoushiBgId").hide();
    $("#waikezhuyaunbuBgId").hide();
    $("#kangfuzhuyaunbuBgId").hide();
    $("#neikeBgId").hide();
    // 线
    $(this).children().eq(1).show();
    $("#fuhankezhuyuanbuId").children().eq(1).hide();
    $("#gukezhuyuanbuId").children().eq(1).hide();
    $("#xuejishiId").children().eq(1).hide();
    $("#waikezhuyuanbuId").children().eq(1).hide();
    $("#neikezhuyuanbuId").children().eq(1).hide();
    $("#kangfuzhuyuanbuId").children().eq(1).hide();
    chuyuanjizhenFun(jzzybArr); //急诊
  });
  $("#gukezhuyuanbuId").click(function () {
    $("#fuchankezhuyuanbuBgId").hide();
    $("#jizhenzhuyuanbuBgId").hide();
    $("#gukezhuyuanbuBgId").show();
    $("#xuetoushiBgId").hide();
    $("#kangfuzhuyaunbuBgId").hide();
    $("#neikeBgId").hide();
    $("#waikezhuyaunbuBgId").hide();
    // 线
    $(this).children().eq(1).show();
    $("#fuhankezhuyuanbuId").children().eq(1).hide();
    $("#jizhenzhuyuanbuId").children().eq(1).hide();
    $("#xuejishiId").children().eq(1).hide();
    $("#waikezhuyuanbuId").children().eq(1).hide();
    $("#neikezhuyuanbuId").children().eq(1).hide();
    $("#kangfuzhuyuanbuId").children().eq(1).hide();
    gukeFun(gukeArr);
  });
  $("#xuejishiId").click(function () {
    $("#fuchankezhuyuanbuBgId").hide();
    $("#jizhenzhuyuanbuBgId").hide();
    $("#gukezhuyuanbuBgId").hide();
    $("#xuetoushiBgId").show();
    $("#kangfuzhuyaunbuBgId").hide();
    $("#neikeBgId").hide();
    $("#waikezhuyaunbuBgId").hide();
    // 线
    $(this).children().eq(1).show();
    $("#fuhankezhuyuanbuId").children().eq(1).hide();
    $("#jizhenzhuyuanbuId").children().eq(1).hide();
    $("#gukezhuyuanbuId").children().eq(1).hide();
    $("#waikezhuyuanbuId").children().eq(1).hide();
    $("#neikezhuyuanbuId").children().eq(1).hide();
    $("#kangfuzhuyuanbuId").children().eq(1).hide();
    xuetoushiFun(xtsArr);
  });
  $("#waikezhuyuanbuId").click(function () {
    $("#fuchankezhuyuanbuBgId").hide();
    $("#jizhenzhuyuanbuBgId").hide();
    $("#gukezhuyuanbuBgId").hide();
    $("#xuetoushiBgId").hide();
    $("#kangfuzhuyaunbuBgId").hide();
    $("#neikeBgId").hide();
    $("#waikezhuyaunbuBgId").show();
    // 线
    $(this).children().eq(1).show();
    $("#fuhankezhuyuanbuId").children().eq(1).hide();
    $("#jizhenzhuyuanbuId").children().eq(1).hide();
    $("#gukezhuyuanbuId").children().eq(1).hide();
    $("#xuejishiId").children().eq(1).hide();
    $("#neikezhuyuanbuId").children().eq(1).hide();
    $("#kangfuzhuyuanbuId").children().eq(1).hide();
    waikeFun(waikeArr);
  });
  $("#neikezhuyuanbuId").click(function () {
    $("#fuchankezhuyuanbuBgId").hide();
    $("#jizhenzhuyuanbuBgId").hide();
    $("#gukezhuyuanbuBgId").hide();
    $("#xuetoushiBgId").hide();
    $("#waikezhuyaunbuBgId").hide();
    $("#kangfuzhuyaunbuBgId").hide();
    $("#neikeBgId").show();
    // 线
    $(this).children().eq(1).show();
    $("#fuhankezhuyuanbuId").children().eq(1).hide();
    $("#jizhenzhuyuanbuId").children().eq(1).hide();
    $("#gukezhuyuanbuId").children().eq(1).hide();
    $("#xuejishiId").children().eq(1).hide();
    $("#waikezhuyuanbuId").children().eq(1).hide();
    $("#kangfuzhuyuanbuId").children().eq(1).hide();
    neikeFun(neikeArr);
  });
  $("#kangfuzhuyuanbuId").click(function () {
    $("#fuchankezhuyuanbuBgId").hide();
    $("#jizhenzhuyuanbuBgId").hide();
    $("#gukezhuyuanbuBgId").hide();
    $("#xuetoushiBgId").hide();
    $("#waikezhuyaunbuBgId").hide();
    $("#neikeBgId").hide();
    $("#kangfuzhuyaunbuBgId").show();
    // 线
    $(this).children().eq(1).show();
    $("#fuhankezhuyuanbuId").children().eq(1).hide();
    $("#jizhenzhuyuanbuId").children().eq(1).hide();
    $("#gukezhuyuanbuId").children().eq(1).hide();
    $("#xuejishiId").children().eq(1).hide();
    $("#waikezhuyuanbuId").children().eq(1).hide();
    $("#neikezhuyuanbuId").children().eq(1).hide();
    kangfuFun(kfllArr);
  });
}
//出院患者费用分析
function chuyuanfeiyongFun() {
  $.ajax({
    type: "get",
    url: server + "/gldaping/getChuYuanCost.do",
    // data: "name=John&location=Boston",
    success: function (msg) {
      // console.log("Data Saved: " + msg);
      var dataArr = $.parseJSON(msg);
      // console.log(dataArr);

      //妇产科住院部
      var fkzybArr = dataArr.fckzyb;

      gekeshichuyuanhuanzhefenxiFun(dataArr);
      chuyuanfukeFun(fkzybArr); //妇科
    },
  });
}

// 出院之妇科
function chuyuanfukeFun(fkzybArr) {
  var rijuncostA = fkzybArr[0].rijuncost;
  var renjunCostA = fkzybArr[0].renjuncost;
  var rijuncostB = fkzybArr[1].rijuncost;
  var renjunCostB = fkzybArr[1].renjuncost;
  var rijuncostC = fkzybArr[2].rijuncost;
  var renjunCostC = fkzybArr[2].renjuncost;
  var rijuncostD = fkzybArr[3].rijuncost;
  var renjunCostD = fkzybArr[3].renjuncost;
  var rijuncostE = fkzybArr[4].rijuncost;
  var renjunCostE = fkzybArr[4].renjuncost;
  var rijuncostF = fkzybArr[5].rijuncost;
  var renjunCostF = fkzybArr[5].renjuncost;
  var myChart = echarts.init(document.getElementById("fuchankezhuyuanbuBgId"));
  option = {
    // color: "#fff",
    legend: {
      // data: ["人均费用", "日均费用"],
      top: "0",
      data: [
        {
          name: "人均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
        {
          name: "日均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
      ],
    },
    grid: {
      left: "0",
      right: "0",
      bottom: "10",
      top: "25",
      show: true,
      containLabel: true,
      width: "98%",
      height: "85%",
    },
    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        max: 10000,
        min: 0,
        splitNumber: 5,
        boundaryGap: [0.1, 0.1],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    axisLabel: {
      color: "#fff",
    },
    series: [
      {
        name: "人均费用",
        type: "line",
        smooth: true,
        // stack: "总量",
        areaStyle: {
          color: "rgba(60,179,113,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#3CB371",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          renjunCostA,
          renjunCostB,
          renjunCostC,
          renjunCostD,
          renjunCostE,
          renjunCostF,
        ],
      },

      {
        name: "日均费用",
        type: "line",
        // stack: "总量",
        smooth: true,

        areaStyle: {
          color: "rgba(250,128,114,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#FA8072",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          rijuncostA,
          rijuncostB,
          rijuncostC,
          rijuncostD,
          rijuncostE,
          rijuncostF,
        ],
      },
    ],
  };
  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
//出院之急诊
function chuyuanjizhenFun(jzzybArr) {
  var rijuncostA = jzzybArr[0].rijuncost;
  var renjunCostA = jzzybArr[0].renjuncost;
  var rijuncostB = jzzybArr[1].rijuncost;
  var renjunCostB = jzzybArr[1].renjuncost;
  var rijuncostC = jzzybArr[2].rijuncost;
  var renjunCostC = jzzybArr[2].renjuncost;
  var myChart = echarts.init(document.getElementById("jizhenzhuyuanbuBgId"));
  option = {
    // color: "#fff",
    legend: {
      // data: ["人均费用", "日均费用"],
      top: "0",
      data: [
        {
          name: "人均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
        {
          name: "日均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
      ],
    },
    grid: {
      left: "0",
      right: "0",
      bottom: "10",
      top: "25",
      show: true,
      containLabel: true,
      width: "98%",
      height: "85%",
    },
    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        max: 10000,
        min: 0,
        splitNumber: 5,
        boundaryGap: [0.1, 0.1],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    axisLabel: {
      color: "#fff",
    },
    series: [
      {
        name: "人均费用",
        type: "line",
        smooth: true,
        // stack: "总量",
        areaStyle: {
          color: "rgba(60,179,113,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#3CB371",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [renjunCostA, renjunCostB, renjunCostC],
      },

      {
        name: "日均费用",
        type: "line",
        // stack: "总量",
        smooth: true,

        areaStyle: {
          color: "rgba(250,128,114,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#FA8072",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [rijuncostA, rijuncostB, rijuncostC],
      },
    ],
  };
  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
// 出院之骨科
function gukeFun(gukeArr) {
  var rijuncostA = gukeArr[0].rijuncost;
  var renjunCostA = gukeArr[0].renjuncost;
  var rijuncostB = gukeArr[1].rijuncost;
  var renjunCostB = gukeArr[1].renjuncost;
  var rijuncostC = gukeArr[2].rijuncost;
  var renjunCostC = gukeArr[2].renjuncost;
  var rijuncostD = gukeArr[3].rijuncost;
  var renjunCostD = gukeArr[3].renjuncost;
  var rijuncostE = gukeArr[4].rijuncost;
  var renjunCostE = gukeArr[4].renjuncost;
  var rijuncostF = gukeArr[5].rijuncost;
  var renjunCostF = gukeArr[5].renjuncost;
  var myChart = echarts.init(document.getElementById("gukezhuyuanbuBgId"));
  option = {
    // color: "#fff",
    legend: {
      // data: ["人均费用", "日均费用"],
      top: "0",
      data: [
        {
          name: "人均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
        {
          name: "日均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
      ],
    },
    grid: {
      left: "0",
      right: "0",
      bottom: "10",
      top: "25",
      show: true,
      containLabel: true,
      width: "98%",
      height: "85%",
    },
    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        max: 10000,
        min: 0,
        splitNumber: 5,
        boundaryGap: [0.1, 0.1],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    axisLabel: {
      color: "#fff",
    },
    series: [
      {
        name: "人均费用",
        type: "line",
        smooth: true,
        // stack: "总量",
        areaStyle: {
          color: "rgba(60,179,113,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#3CB371",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          renjunCostA,
          renjunCostB,
          renjunCostC,
          renjunCostD,
          renjunCostE,
          renjunCostF,
        ],
      },

      {
        name: "日均费用",
        type: "line",
        // stack: "总量",
        smooth: true,

        areaStyle: {
          color: "rgba(250,128,114,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#FA8072",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          rijuncostA,
          rijuncostB,
          rijuncostC,
          rijuncostD,
          rijuncostE,
          rijuncostF,
        ],
      },
    ],
  };
  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
// 出院之血透室
function xuetoushiFun(xtsArr) {
  var myChart = echarts.init(document.getElementById("xuetoushiBgId"));
  var rijuncostA = xtsArr[0].rijuncost;
  var renjunCostA = xtsArr[0].renjuncost;
  var rijuncostB = xtsArr[1].rijuncost;
  var renjunCostB = xtsArr[1].renjuncost;
  var rijuncostC = xtsArr[2].rijuncost;
  var renjunCostC = xtsArr[2].renjuncost;
  var rijuncostD = xtsArr[3].rijuncost;
  var renjunCostD = xtsArr[3].renjuncost;
  var rijuncostE = xtsArr[4].rijuncost;
  var renjunCostE = xtsArr[4].renjuncost;
  var rijuncostF = xtsArr[5].rijuncost;
  var renjunCostF = xtsArr[5].renjuncost;
  option = {
    // color: "#fff",
    legend: {
      // data: ["人均费用", "日均费用"],
      top: "0",
      data: [
        {
          name: "人均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
        {
          name: "日均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
      ],
    },
    grid: {
      left: "0",
      right: "0",
      bottom: "10",
      top: "25",
      show: true,
      containLabel: true,
      width: "98%",
      height: "85%",
    },
    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        max: 10000,
        min: 0,
        splitNumber: 5,
        boundaryGap: [0.1, 0.1],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    axisLabel: {
      color: "#fff",
    },
    series: [
      {
        name: "人均费用",
        type: "line",
        smooth: true,
        // stack: "总量",
        areaStyle: {
          color: "rgba(60,179,113,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#3CB371",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          renjunCostA,
          renjunCostB,
          renjunCostC,
          renjunCostD,
          renjunCostE,
          renjunCostF,
        ],
      },

      {
        name: "日均费用",
        type: "line",
        // stack: "总量",
        smooth: true,

        areaStyle: {
          color: "rgba(250,128,114,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#FA8072",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          rijuncostA,
          rijuncostB,
          rijuncostC,
          rijuncostD,
          rijuncostE,
          rijuncostF,
        ],
      },
    ],
  };
  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
//出院之 外科
function waikeFun(waikeArr) {
  var myChart = echarts.init(document.getElementById("waikezhuyaunbuBgId"));
  var rijuncostA = waikeArr[0].rijuncost;
  var renjunCostA = waikeArr[0].renjuncost;
  var rijuncostB = waikeArr[1].rijuncost;
  var renjunCostB = waikeArr[1].renjuncost;
  var rijuncostC = waikeArr[2].rijuncost;
  var renjunCostC = waikeArr[2].renjuncost;
  var rijuncostD = waikeArr[3].rijuncost;
  var renjunCostD = waikeArr[3].renjuncost;
  var rijuncostE = waikeArr[4].rijuncost;
  var renjunCostE = waikeArr[4].renjuncost;
  var rijuncostF = waikeArr[5].rijuncost;
  var renjunCostF = waikeArr[5].renjuncost;
  option = {
    // color: "#fff",
    legend: {
      // data: ["人均费用", "日均费用"],
      top: "0",
      data: [
        {
          name: "人均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
        {
          name: "日均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
      ],
    },
    grid: {
      left: "0",
      right: "0",
      bottom: "10",
      top: "25",
      show: true,
      containLabel: true,
      width: "98%",
      height: "85%",
    },
    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        max: 10000,
        min: 0,
        splitNumber: 5,
        boundaryGap: [0.1, 0.1],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    axisLabel: {
      color: "#fff",
    },
    series: [
      {
        name: "人均费用",
        type: "line",
        smooth: true,
        // stack: "总量",
        areaStyle: {
          color: "rgba(60,179,113,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#3CB371",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          renjunCostA,
          renjunCostB,
          renjunCostC,
          renjunCostD,
          renjunCostE,
          renjunCostF,
        ],
      },

      {
        name: "日均费用",
        type: "line",
        // stack: "总量",
        smooth: true,

        areaStyle: {
          color: "rgba(250,128,114,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#FA8072",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          rijuncostA,
          rijuncostB,
          rijuncostC,
          rijuncostD,
          rijuncostE,
          rijuncostF,
        ],
      },
    ],
  };
  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
// 出院之内科
function neikeFun(neikeArr) {
  var myChart = echarts.init(document.getElementById("neikeBgId"));
  var rijuncostA = neikeArr[0].rijuncost;
  var renjunCostA = neikeArr[0].renjuncost;
  var rijuncostB = neikeArr[1].rijuncost;
  var renjunCostB = neikeArr[1].renjuncost;
  var rijuncostC = neikeArr[2].rijuncost;
  var renjunCostC = neikeArr[2].renjuncost;
  var rijuncostD = neikeArr[3].rijuncost;
  var renjunCostD = neikeArr[3].renjuncost;
  var rijuncostE = neikeArr[4].rijuncost;
  var renjunCostE = neikeArr[4].renjuncost;
  var rijuncostF = neikeArr[5].rijuncost;
  var renjunCostF = neikeArr[5].renjuncost;
  option = {
    // color: "#fff",
    legend: {
      // data: ["人均费用", "日均费用"],
      top: "0",
      data: [
        {
          name: "人均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
        {
          name: "日均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
      ],
    },
    grid: {
      left: "0",
      right: "0",
      bottom: "10",
      top: "25",
      show: true,
      containLabel: true,
      width: "98%",
      height: "85%",
    },
    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        max: 10000,
        min: 0,
        splitNumber: 5,
        boundaryGap: [0.1, 0.1],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    axisLabel: {
      color: "#fff",
    },
    series: [
      {
        name: "人均费用",
        type: "line",
        smooth: true,
        // stack: "总量",
        areaStyle: {
          color: "rgba(60,179,113,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#3CB371",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          renjunCostA,
          renjunCostB,
          renjunCostC,
          renjunCostD,
          renjunCostE,
          renjunCostF,
        ],
      },

      {
        name: "日均费用",
        type: "line",
        // stack: "总量",
        smooth: true,

        areaStyle: {
          color: "rgba(250,128,114,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#FA8072",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          rijuncostA,
          rijuncostB,
          rijuncostC,
          rijuncostD,
          rijuncostE,
          rijuncostF,
        ],
      },
    ],
  };
  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}
// 出院之康复
function kangfuFun(kfllArr) {
  var myChart = echarts.init(document.getElementById("kangfuzhuyaunbuBgId"));
  var rijuncostA = kfllArr[0].rijuncost;
  var renjunCostA = kfllArr[0].renjuncost;
  var rijuncostB = kfllArr[1].rijuncost;
  var renjunCostB = kfllArr[1].renjuncost;
  var rijuncostC = kfllArr[2].rijuncost;
  var renjunCostC = kfllArr[2].renjuncost;
  var rijuncostD = kfllArr[3].rijuncost;
  var renjunCostD = kfllArr[3].renjuncost;
  var rijuncostE = kfllArr[4].rijuncost;
  var renjunCostE = kfllArr[4].renjuncost;
  option = {
    // color: "#fff",
    legend: {
      // data: ["人均费用", "日均费用"],
      top: "0",
      data: [
        {
          name: "人均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
        {
          name: "日均费用",
          // 强制设置图形为圆。
          icon: "circle",
          // 设置文本为红色
          textStyle: {
            color: "#fff",
          },
        },
      ],
    },
    grid: {
      left: "0",
      right: "0",
      bottom: "10",
      top: "25",
      show: true,
      containLabel: true,
      width: "98%",
      height: "85%",
    },
    xAxis: [
      {
        type: "category",
        boundaryGap: false,
        data: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    yAxis: [
      {
        type: "value",
        max: 10000,
        min: 0,
        splitNumber: 5,
        boundaryGap: [0.1, 0.1],
        axisLabel: {
          textStyle: {
            color: "#0cf0ff",
            fontSize: "12",
          },
        },
        axisLine: {
          lineStyle: {
            color: "#0cf0ff",
          },
        },
      },
    ],
    axisLabel: {
      color: "#fff",
    },
    series: [
      {
        name: "人均费用",
        type: "line",
        smooth: true,
        // stack: "总量",
        areaStyle: {
          color: "rgba(60,179,113,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#3CB371",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          renjunCostA,
          renjunCostB,
          renjunCostC,
          renjunCostD,
          renjunCostE,
          // renjunCostF,
        ],
      },

      {
        name: "日均费用",
        type: "line",
        // stack: "总量",
        smooth: true,

        areaStyle: {
          color: "rgba(250,128,114,0.2)",
        },
        symbol: "circle",
        symbolSize: 7,
        showSymbol: true,
        itemStyle: {
          color: "#FA8072",
          // border: "rabg(23,92,108,0.5)",
          borderWidth: 10,
        },
        data: [
          rijuncostA,
          rijuncostB,
          rijuncostC,
          rijuncostD,
          rijuncostE,
          // rijuncostF,
        ],
      },
    ],
  };
  myChart.setOption(option);
  window.addEventListener("resize", function () {
    myChart.resize();
  });
}

//住院人数分析
function zhuyuanrenshuFun() {
  // console.log(222);
  var myChart = echarts.init(document.getElementById("zhuyuanLiClaId"));
  $.ajax({
    type: "get",
    url: server + "/gldaping/getKeShiZhuYuanNum.do",
    // data: "name=John&location=Boston",
    success: function (msg) {
      // console.log("Data Saved: " + msg);
      var dataArr = $.parseJSON(msg).zhuyuanrenshu;
      // console.log(dataArr);
      var xuetoushiText = dataArr[0].deptname;
      var xuetoushiCost = dataArr[0].num;
      var neikezhuyuanbuText = dataArr[1].deptname;
      var neikezhuyuanbuCost = dataArr[1].num;
      var fukezhuyuanbuText = dataArr[2].deptname;
      var fukezhuyuanbuCost = dataArr[2].num;
      var waikezhuyuanbuText = dataArr[3].deptname;
      var waikezhuyuanbuCost = dataArr[3].num;
      var jizhenzhuyuanbuText = dataArr[4].deptname;
      var jizhenzhuyuanbuCost = dataArr[4].num;
      var kangfuliliaoText = dataArr[5].deptname;
      var kangfuliliaoCost = dataArr[5].num;
      var gukezhuyuanbuText = dataArr[6].deptname;
      var gukezhuyuanbuCost = dataArr[6].num;

      option = {
        series: [
          {
            type: "pie",
            radius: "70%",
            center: ["50%", "50%"],
            // selectedMode: "single",
            width: "auto",
            height: "auto",
            left: "10",
            top: "0",
            avoidLabelOverlap: true,
            minAngle: 60,
            data: [
              {
                value: xuetoushiCost,
                name: xuetoushiText,
                label: {
                  //引导线文字设置
                  // backgroundColor: "#f00",
                  color: "#FA8072",
                  formatter: "{b}:{d}%",
                },
                itemStyle: {
                  color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "#FA8072", // 0% 处的颜色
                      },
                      {
                        offset: 1,
                        color: "#FA8072", // 100% 处的颜色
                      },
                    ],
                  },
                },
              },
              {
                value: neikezhuyuanbuCost,
                name: neikezhuyuanbuText,
                label: {
                  //引导线文字设置
                  // backgroundColor: "#f00",
                  color: "#3CB371",
                  formatter: "{b}:{d}%",
                },
                itemStyle: {
                  color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "#3CB371", // 0% 处的颜色
                      },
                      {
                        offset: 1,
                        color: "#3CB371", // 100% 处的颜色
                      },
                    ],
                  },
                },
              },
              {
                value: fukezhuyuanbuCost,
                name: fukezhuyuanbuText,
                label: {
                  //引导线文字设置
                  // backgroundColor: "#f00",
                  color: "#4BD0E2",
                  formatter: "{b}:{d}%",
                },
                itemStyle: {
                  color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "#4BD0E2", // 0% 处的颜色
                      },
                      {
                        offset: 1,
                        color: "#4BD0E2", // 100% 处的颜色
                      },
                    ],
                  },
                },
              },
              {
                value: waikezhuyuanbuCost,
                name: waikezhuyuanbuText,
                label: {
                  //引导线文字设置
                  // backgroundColor: "#f00",
                  color: "#1A9AFA",
                  formatter: "{b}:{d}%",
                },
                itemStyle: {
                  color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "#1A9AFA", // 0% 处的颜色
                      },
                      {
                        offset: 1,
                        color: "#1A9AFA", // 100% 处的颜色
                      },
                    ],
                  },
                },
              },
              {
                value: jizhenzhuyuanbuCost,
                name: jizhenzhuyuanbuText,
                label: {
                  //引导线文字设置
                  // backgroundColor: "#f00",
                  color: "#FDC0EB",
                  formatter: "{b}:{d}%",
                },
                itemStyle: {
                  color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "#FDC0EB", // 0% 处的颜色
                      },
                      {
                        offset: 1,
                        color: "#FDC0EB", // 100% 处的颜色
                      },
                    ],
                  },
                },
              },
              {
                value: kangfuliliaoCost,
                name: kangfuliliaoText,
                label: {
                  //引导线文字设置
                  // backgroundColor: "#f00",
                  color: "#F7D36A",
                  formatter: "{b}:{d}%",
                },
                itemStyle: {
                  color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "#F7D36A", // 0% 处的颜色
                      },
                      {
                        offset: 1,
                        color: "#F7D36A", // 100% 处的颜色
                      },
                    ],
                  },
                },
              },
              {
                value: gukezhuyuanbuCost,
                name: gukezhuyuanbuText,
                label: {
                  //引导线文字设置
                  // backgroundColor: "#f00",
                  color: "#FFA378",
                  formatter: "{b}:{d}%",
                },
                itemStyle: {
                  color: {
                    type: "linear",
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [
                      {
                        offset: 0,
                        color: "#FFA378", // 0% 处的颜色
                      },
                      {
                        offset: 1,
                        color: "#FFA378", // 100% 处的颜色
                      },
                    ],
                  },
                },
              },
            ],
          },
        ],
      };
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    },
  });
}
// 门诊费用分析Tab
function keshimenzhenTabsFun(dataArr) {
  $("#yaopinfeiyongLiId").click(function () {
    $("#mengzhengfeiyongBgId").hide();
    $("#renjunfeiyongBgId").hide();
    $("#yaopinfeiyongBgId").show();
    // 线
    $(this).children().eq(1).show();
    $("#mengzhengfeiyongLiId").children().eq(1).hide();
    $("#renjunfeiyongLiId").children().eq(1).hide();
    //调图表方法
    yaopinfeiyongfenxiFun(dataArr);
  });
  $("#renjunfeiyongLiId").click(function () {
    $("#mengzhengfeiyongBgId").hide();
    $("#renjunfeiyongBgId").show();
    $("#yaopinfeiyongBgId").hide();
    // 线
    $(this).children().eq(1).show();
    $("#mengzhengfeiyongLiId").children().eq(1).hide();
    $("#yaopinfeiyongLiId").children().eq(1).hide();

    //调图表方法
    renjunfeiyongfenxiFun(dataArr);
  });
  $("#mengzhengfeiyongLiId").click(function () {
    $("#mengzhengfeiyongBgId").show();
    $("#renjunfeiyongBgId").hide();
    $("#yaopinfeiyongBgId").hide();
    // 线
    $(this).children().eq(1).show();
    $("#yaopinfeiyongLiId").children().eq(1).hide();
    $("#renjunfeiyongLiId").children().eq(1).hide();

    //调图表方法
  });
}

//门诊费用分析
function menzhenfeiyongfenxiFun() {
  // console.log(33333);
  var myChart = echarts.init(document.getElementById("mengzhengfeiyongBgId"));
  $.ajax({
    type: "get",
    url: server + "/gldaping/getdata2.do",
    // data: "name=John&location=Boston",
    success: function (msg) {
      console.log("Data Saved: " + msg);
      var dataArr = $.parseJSON(msg).mzcost;
      //门诊
      keshimenzhenTabsFun(dataArr);
      // x轴
      var zhongyike = dataArr[0].deptname;
      var pifuke = dataArr[1].deptname;
      var jizhenke = dataArr[2].deptname;
      var waikemenzhen = dataArr[3].deptname;
      var fuchankemenzhen = dataArr[4].deptname;
      var neikemenzhen = dataArr[5].deptname;
      // y轴
      var zhongyikeVal = dataArr[0].mcost;
      var pifukeVal = dataArr[1].mcost;
      var jizhenkeVal = dataArr[2].mcost;
      var waikemenzhenVal = dataArr[3].mcost;
      var fuchankemenzhenVal = dataArr[4].mcost;
      var neikemenzhenVal = dataArr[5].mcost;
      console.log(neikemenzhenVal);
      option = {
        grid: {
          left: 0,
          right: 0,
          bottom: -10,
          containLabel: true,
          show: true,
          width: "100%",
          height: "100%",
        },
        xAxis: {
          type: "category",
          // splitNumber = 6,
          splitLine: { show: false },
          axisLabel: {
            show: true,
            color: "#fff",
            fontSize: 10,
            interval: 0,
            rotate: 15,
          },
          data: [
            zhongyike,
            pifuke,
            jizhenke,
            waikemenzhen,
            fuchankemenzhen,
            neikemenzhen,
          ],
        },
        yAxis: {
          type: "value",
          max: 300000,
          min: 0,
          splitNumber: 5,
          boundaryGap: [0.1, 0.1],

          axisLabel: {
            show: true,
            color: "#fff",
            fontSize: 12,
            splitNumber: 1,
            minInterval: 1,
            interval: 1,
          },
        },
        series: [
          {
            type: "bar",
            // stack: "总量",
            itemStyle: {
              barBorderColor: "#e8b5e4",
              color: "#e8b5e4",
              borderWidth: 1,
              barBorderRadius: 10,
            },
            barWidth: 10,
            barCategoryGap: 5,
            data: [
              zhongyikeVal,
              pifukeVal,
              jizhenkeVal,
              waikemenzhenVal,
              fuchankemenzhenVal,
              neikemenzhenVal,
            ],
          },
        ],
      };
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    },
  });
}
// 门诊费用分析之药品费用
function yaopinfeiyongfenxiFun(dataArr) {
  // console.log(dataArr);
  var myChart = echarts.init(document.getElementById("yaopinfeiyongBgId"));
  $.ajax({
    type: "get",
    url: server + "/gldaping/getdata2.do",
    // data: "name=John&location=Boston",
    success: function (msg) {
      // console.log("Data Saved: " + msg);

      var dataArr = $.parseJSON(msg).mzcost;
      // x轴
      var zhongyike = dataArr[0].deptname;
      var pifuke = dataArr[1].deptname;
      var jizhenke = dataArr[2].deptname;
      var waikemenzhen = dataArr[3].deptname;
      var fuchankemenzhen = dataArr[4].deptname;
      var neikemenzhen = dataArr[5].deptname;
      // y轴
      var zhongyikeVal = dataArr[0].ypcost;
      var pifukeVal = dataArr[1].ypcost;
      var jizhenkeVal = dataArr[2].ypcost;
      var waikemenzhenVal = dataArr[3].ypcost;
      var fuchankemenzhenVal = dataArr[4].ypcost;
      var neikemenzhenVal = dataArr[5].ypcost;
      // console.log(neikemenzhenVal);
      option = {
        grid: {
          left: 0,
          right: 0,
          bottom: -8,
          containLabel: true,
          show: true,
          width: "100%",
          height: "100%",
        },
        xAxis: {
          type: "category",
          // splitNumber = 6,
          splitLine: { show: false },
          axisLabel: {
            show: true,
            color: "#fff",
            fontSize: 10,
            interval: 0,
            rotate: 10,
          },
          data: [
            zhongyike,
            pifuke,
            jizhenke,
            waikemenzhen,
            fuchankemenzhen,
            neikemenzhen,
          ],
        },
        yAxis: {
          type: "value",
          max: 300000,
          min: 0,
          splitNumber: 5,
          boundaryGap: [0.1, 0.1],

          axisLabel: {
            show: true,
            color: "#fff",
            fontSize: 12,
            splitNumber: 1,
            minInterval: 1,
            interval: 1,
          },
        },
        series: [
          {
            type: "bar",
            // stack: "总量",
            itemStyle: {
              barBorderColor: "#e8b5e4",
              color: "#e8b5e4",
              borderWidth: 1,
              barBorderRadius: 10,
            },
            barWidth: 10,
            barCategoryGap: 5,
            data: [
              zhongyikeVal,
              pifukeVal,
              jizhenkeVal,
              waikemenzhenVal,
              fuchankemenzhenVal,
              neikemenzhenVal,
            ],
          },
        ],
      };

      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    },
  });
}
// 门诊费用分析之药品人均费用
function renjunfeiyongfenxiFun(dataArr) {
  console.log(dataArr);
  var myChart = echarts.init(document.getElementById("renjunfeiyongBgId"));
  $.ajax({
    type: "get",
    url: server + "/gldaping/getdata2.do",
    // data: "name=John&location=Boston",
    success: function (msg) {
      // console.log("Data Saved: " + msg);

      var dataArr = $.parseJSON(msg).mzcost;
      // x轴
      var zhongyike = dataArr[0].deptname;
      var pifuke = dataArr[1].deptname;
      var jizhenke = dataArr[2].deptname;
      var waikemenzhen = dataArr[3].deptname;
      var fuchankemenzhen = dataArr[4].deptname;
      var neikemenzhen = dataArr[5].deptname;
      // y轴
      var zhongyikeVal = dataArr[0].renjun;
      var pifukeVal = dataArr[1].renjun;
      var jizhenkeVal = dataArr[2].renjun;
      var waikemenzhenVal = dataArr[3].renjun;
      var fuchankemenzhenVal = dataArr[4].renjun;
      var neikemenzhenVal = dataArr[5].renjun;
      console.log(neikemenzhenVal);
      option = {
        grid: {
          left: 0,
          right: 0,
          bottom: -8,
          containLabel: true,
          show: true,
          width: "100%",
          height: "100%",
        },
        xAxis: {
          type: "category",
          // splitNumber = 6,
          splitLine: { show: false },
          axisLabel: {
            show: true,
            color: "#fff",
            fontSize: 10,
            interval: 0,
            rotate: 10,
          },
          data: [
            zhongyike,
            pifuke,
            jizhenke,
            waikemenzhen,
            fuchankemenzhen,
            neikemenzhen,
          ],
        },
        yAxis: {
          type: "value",
          max: 2000,
          min: 0,
          splitNumber: 5,
          boundaryGap: [0.1, 0.1],

          axisLabel: {
            show: true,
            color: "#fff",
            fontSize: 12,
            splitNumber: 1,
            minInterval: 1,
            interval: 1,
          },
        },
        series: [
          {
            type: "bar",
            // stack: "总量",
            itemStyle: {
              barBorderColor: "#e8b5e4",
              color: "#e8b5e4",
              borderWidth: 1,
              barBorderRadius: 10,
            },
            barWidth: 10,
            barCategoryGap: 5,
            data: [
              zhongyikeVal,
              pifukeVal,
              jizhenkeVal,
              waikemenzhenVal,
              fuchankemenzhenVal,
              neikemenzhenVal,
            ],
          },
        ],
      };

      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    },
  });
}
//就诊诊断分析
function jiuzhenzhenduanfenxiFun() {
  var myChart = echarts.init(document.getElementById("jiuzhenfeiyongLiClaId"));
  $.ajax({
    type: "get",
    url: server + "/gldaping/getJiuZenNumSort.do",
    // data: "name=John&location=Boston",
    success: function (msg) {
      console.log("Data Saved: " + msg);
      var dataArr = $.parseJSON(msg).jiuzensort;
      console.log(dataArr);
      var gaoxueyaText = dataArr[0].diagname;
      var gaoxueyaVal = dataArr[0].num;
      var tangniaobingText = dataArr[1].diagname;
      var tangniaobingVal = dataArr[1].num;
      var songshangText = dataArr[2].diagname;
      var songshangVal = dataArr[2].num;
      var naogengsiText = dataArr[3].diagname;
      var naogengsiVal = dataArr[3].num;
      var futongText = dataArr[4].diagname;
      var futongVal = dataArr[4].num;
      var simianText = dataArr[5].diagname;
      var simianVal = dataArr[5].num;
      var niaoduText = dataArr[6].diagname;
      var niaoduVal = dataArr[6].num;
      var naotengText = dataArr[7].diagname;
      var naotengVal = dataArr[7].num;
      var touyunText = dataArr[8].diagname;
      var touyunVal = dataArr[8].num;
      var xinzangbingText = dataArr[9].diagname;
      var xinzangbingVal = dataArr[9].num;

      // 床位周转率 病床使用率 名称
      // var html = "";
      // var arrNumber = [];
      // $.each(dataArr, function (x, y) {
      //   var keshiname = y.diagname;
      //   var numberS = y.num;
      //   arrNumber.push(numberS); //向数组中追加元素
      //   console.log(numberS);
      //   var sumS = sum(arrNumber);
      //   console.log(sumS);

      //   html += " <li class='itmeBg'>";
      //   html += " <p>" + keshiname + "</p>";
      //   html += "<div>";
      //   html += " <p></p>";
      //   html += " </div>";
      //   html += " <p>96%</p>";
      //   html += "</li>";
      // });
      // $("#jiuzhenpaihangId").append(html);
      var myColor = [
        "#1089E7",
        "#F57474",
        "#56D0E3",
        "#F8B448",
        "#8B78F6",
        "#1089E7",
        "#F57474",
        "#56D0E3",
        "#F8B448",
        "#8B78F6",
      ];
      option = {
        // tooltip: {
        //   trigger: "axis",
        //   axisPointer: {
        //     type: "shadow",
        //   },
        // },

        grid: {
          left: "22%",
          right: "12%",
          bottom: "5%",
          top: "15%",
          containLabel: false,
        },
        // 不显示x轴信息
        xAxis: {
          show: false,
        },
        // 不显示y轴线和相关刻度
        yAxis: [
          {
            type: "category",
            inverse: true,
            data: [
              gaoxueyaText,
              tangniaobingText,
              songshangText,
              naogengsiText,
              futongText,
              simianText,
              niaoduText,
              naotengText,
              touyunText,
              // xinzangbingText,
            ],
            axisLine: {
              show: false,
            },
            axisTick: {
              show: false,
            },
            axisLabel: {
              color: "#fff",
              fontSize: 10,
            },
          },
          {
            type: "category",
            inverse: true,
            data: [
              gaoxueyaVal,
              tangniaobingVal,
              songshangVal,
              naogengsiVal,
              futongVal,
              simianVal,
              niaoduVal,
              naotengVal,
              touyunVal,
              // xinzangbingVal,
            ],
            axisLine: {
              show: false,
            },
            axisTick: {
              show: false,
            },
            axisLabel: {
              color: "#fff",
              fontSize: 10,
            },
          },
        ],
        series: [
          {
            name: "条",
            type: "bar",
            barCategoryGap: 20,
            barWidth: 7,
            yAxisIndex: 0,
            itemStyle: {
              barBorderRadius: 20,
              color: function (params) {
                // console.log(params);
                return myColor[params.dataIndex];
              },
            },
            data: [
              gaoxueyaVal,
              tangniaobingVal,
              songshangVal,
              naogengsiVal,
              futongVal,
              simianVal,
              niaoduVal,
              naotengVal,
              touyunVal,
              xinzangbingVal,
            ],
          },
          {
            name: "框",
            type: "bar",
            barCategoryGap: 20,
            barWidth: 12,
            yAxisIndex: 1,
            itemStyle: {
              color: "none",
              borderColor: "#00c1de",
              borderWidth: 3,
              barBorderRadius: 15,
            },
            data: [
              10000,
              10000,
              10000,
              10000,
              10000,
              10000,
              10000,
              10000,
              10000,
              // 10000,
            ],
          },
        ],
      };

      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    },
  });
}
// 床位使用分析
function chuangweishiyongfenxiFun() {
  var myChart = echarts.init(
    document.getElementById("chaungweishiyongfenxiId")
  );
  $.ajax({
    type: "get",
    url: server + "/gldaping/getBingChuangData.do",
    // data: "name=John&location=Boston",
    success: function (msg) {
      // console.log("Data Saved: " + msg);
      var dataArr = $.parseJSON(msg).bc;
      // console.log(dataArr);
      // 床位周转率 病床使用率 名称

      var keshimingchengA = dataArr[0].deptname;
      var zhouzhuanlvA = dataArr[0].bcutilization;
      var shiyonglvA = dataArr[0].bcturnover;
      // 护士站二 dataArr[0].nursecellname;
      // 护士站二 dataArr[1].nursecellname;
      var keshimingchengB = dataArr[2].deptname;
      var zhouzhuanlvB = dataArr[2].bcutilization;
      var shiyonglvB = dataArr[2].bcturnover;
      var keshimingchengC = dataArr[3].deptname;
      var zhouzhuanlvC = dataArr[3].bcutilization;
      var shiyonglvC = dataArr[3].bcturnover;
      var keshimingchengD = dataArr[4].deptname;
      var zhouzhuanlvD = dataArr[4].bcutilization;
      var shiyonglvD = dataArr[4].bcturnover;
      var keshimingchengE = dataArr[5].deptname;
      var zhouzhuanlvE = dataArr[5].bcutilization;
      var shiyonglvE = dataArr[5].bcturnover;
      var keshimingchengF = dataArr[6].deptname;
      var zhouzhuanlvF = dataArr[6].bcutilization;
      var shiyonglvF = dataArr[6].bcturnover;
      option = {
        // color: "#fff",

        grid: {
          left: "20",
          right: "0",
          bottom: "10",
          top: "30",
          show: true,
          containLabel: true,
          width: "90%",
          height: "85%",
        },
        xAxis: [
          {
            type: "category",
            boundaryGap: false,
            splitLine: { show: false },
            axisLabel: {
              textStyle: {
                show: true,
                color: "#fff",
                fontSize: 10,
              },
              interval: 0,
              rotate: 15,
            },
            axisLine: {
              lineStyle: {
                color: "#0cf0ff",
              },
            },
            data: [
              keshimingchengA,
              keshimingchengB,
              keshimingchengC,
              keshimingchengD,
              keshimingchengE,
              keshimingchengF,
            ],
          },
        ],
        yAxis: [
          {
            type: "value",
            max: 10,
            min: 0,
            splitNumber: 5,
            boundaryGap: [0.1, 0.1],
            axisLabel: {
              textStyle: {
                color: "#0cf0ff",
                fontSize: "12",
              },
            },
            axisLine: {
              lineStyle: {
                color: "#0cf0ff",
              },
            },
          },
        ],
        axisLabel: {
          color: "#fff",
        },
        series: [
          {
            name: "病床使用率",
            type: "line",
            smooth: true,
            // stack: "总量",
            areaStyle: {
              color: "rgba(60,179,113,0.2)",
            },
            symbol: "circle",
            symbolSize: 7,
            showSymbol: true,
            itemStyle: {
              color: "#3CB371",
              // border: "rabg(23,92,108,0.5)",
              borderWidth: 10,
            },
            data: [
              zhouzhuanlvA,
              zhouzhuanlvB,
              zhouzhuanlvC,
              zhouzhuanlvD,
              zhouzhuanlvE,
              zhouzhuanlvF,
            ],
          },

          {
            name: "病床周转率",
            type: "line",
            // stack: "总量",
            smooth: true,

            areaStyle: {
              color: "rgba(250,128,114,0.2)",
            },
            symbol: "circle",
            symbolSize: 7,
            showSymbol: true,
            itemStyle: {
              color: "#FA8072",
              // border: "rabg(23,92,108,0.5)",
              borderWidth: 10,
            },
            data: [
              shiyonglvA,
              shiyonglvB,
              shiyonglvC,
              shiyonglvD,
              shiyonglvE,
              shiyonglvF,
            ],
          },
        ],
      };
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    },
  });
}
